#pragma once
#include <cstdint>
#include <string>
#include <memory>
#include "vortex/core/blob.h"

namespace vortex
{
    // structure for image io with stbimage
    struct ImageIO
    {
        uint32_t width = 0;
        uint32_t height = 0;
        uint32_t channels = 0;
        uint8_t* data = nullptr;

        uint32_t Size() const { return width * height * channels; }

        bool Read(const std::string& filePath, uint32_t channels = 3);
        bool Write(const std::string& filePath) const;
    };

    bool Imread(const std::string& filePath, ImageIO& image, uint32_t channels = 3);
    bool Imwrite(const std::string& filePath, const ImageIO& image);

}
